﻿//首页大广告
var gg960ShowTime = 6000; //播放时间
var gg960Time = null;

function open_gg960(showBtn){
    $('.gg_full .gg_fcon').html(gg960Con).slideDown(300,function(){
        if(showBtn !== false){
            $('.gg_full .gg_fbtn').fadeIn();
        }
        //自动关闭
        if(gg960Time){clearTimeout(gg960Time);}
        gg960Time = setTimeout(close_gg960,gg960ShowTime);
    });
}
function close_gg960(){
    $('.gg_full .gg_fcon').slideUp(500,function(){
        $(this).html('');
        $('.gg_fclose').hide();
        $('.gg_freplay').show();
    });
}
$('.gg_fclose').click(function(){
    if(gg960Time){clearTimeout(gg960Time);}
    close_gg960();
    return false;
});
$('.gg_freplay').click(function(){
    if(gg960Time){clearTimeout(gg960Time);}
    open_gg960(false);
    $('.gg_freplay').hide();
    $('.gg_fclose').show();
    return false;
});


/*
$(function () {
    showHeader('image', 'showHeader.jpg'); //显示方式(image|swf)  显示文件名
});
*/
var gg960Con;
function showHeader(showType, showFile) {
    if (showFile) {
        if (showType == 'swf') {
            gg960Con = '<embed wmode="transparent" width="800" height="300" src=' + showFile + ' allowscriptaccess="always" quality="high" name="Advertisement" id="Advertisement" type="application/x-shockwave-flash"></embed>';
        }
        else {
            gg960Con = '<img width="800" height="300" src=' + showFile + ' />'; //flash无法显示时，显示JPG图片
        }
        setTimeout(open_gg960, 2000); //延迟显示
    }
}
